local kongchengAudio = fk.CreateSkill {

  name = "#joyex__kongchengAudio",

  tags = {  },

}



kongchengAudio:addEffect(fk.AfterCardsMove, {
  refresh_events = {fk.AfterCardsMove},
  can_refresh = function(self, event, target, player, data)
    if not player:hasSkill(kongchengAudio.name) then return end
    if not player:isKongcheng() then return end
    for _, move in ipairs(data) do
      if move.from == player then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerHand then
            return true
          end
        end
      end
    end
  end,
  on_refresh = function(self, event, target, player, data)
    player:broadcastSkillInvoke("joyex__kongcheng")
    player.room:notifySkillInvoked(player, "joyex__kongcheng", "defensive")
  end,
})

return kongchengAudio